#ifndef PCAP_ADAPTER_H
#define PCAP_ADAPTER_H

#include <stdint.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef void (*pcap_recv_cb)(const uint8_t* pkt, size_t len, void* ctx);

int pcap_adapter_open(const char* device, void** handle_out); // 返回0成功
int pcap_adapter_send(void* handle, const uint8_t* pkt, size_t len);
int pcap_adapter_start_recv(void* handle, pcap_recv_cb cb, void* ctx);
int pcap_adapter_stop_recv(void* handle);
int pcap_adapter_close(void* handle);

#ifdef __cplusplus
}
#endif

#endif // PCAP_ADAPTER_H
